var mapa = {
	id: "mapa",

	_nivel: [],

	visible: true,

	init: function () {

		this._nivel[0] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
        this._nivel[1] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
        this._nivel[2] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
        this._nivel[3] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[4] = [0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[5] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[6] = [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[7] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[8] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[9] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[10] = [0,0,0,0,0,1,1,0,0,0,0,0,2,1,1,1,0,0,0,0];
                this._nivel[11] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
                this._nivel[12] = [0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0];
		this._nivel[13] = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
		this._nivel[14] = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
	},

	update: function (delta) {
	},

	draw: function (context) {

		context.save();
			for (var i = 0; i < this._nivel.length; i++) {
                                        for (var j = 0; j < this._nivel[i].length; j++) {
                                                if (this._nivel[i][j] !== 0) {
                                                        context.drawImage(jsGFwk.ResourceManager.graphics.sprites.image,
                                                        373, 47, 16, 16, 
                                                        (j * 16), (i * 16), 16, 16);
                                                }
                                        }
                                }
		context.restore();

	},

	_getGridRelation: function (x, y) {
        	return { 
			x: Math.floor(x / 16),
                	y: Math.floor(y / 16),
			tile: jsGFwk._gameObjects.mapa._nivel[Math.floor(y / 16)][Math.floor(x / 16)] 
		};
        },
};